#include "../source/server.hpp"

using namespace wyl;

int main()
{
  for(int i = 0 ; i < 10 ; i++)
  {
    pid_t ret = fork();
    if(ret <0 )
    {
      abort();
    }else if(ret == 0)
    {
       Socket cli;
       cli.CreateClient(8081,"47.113.218.27");
       std::string req = "GET /hello HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n";
       while(1)
       {
         assert(cli.Send(req.c_str(),req.size())!= -1);
         char buf[1024] = {0};
         assert(cli.Recv(buf,1023));
         DLOG("[%s]",buf);
         sleep(25);
       }
       cli.Close();
    }
  }
  while(1)sleep(10);
  return 0;
}
